package cn.com.shopec.erp.purchase.dao.impl;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import cn.com.shopec.erp.common.orm.impl.HibernateEntityDao;
import cn.com.shopec.erp.purchase.dao.IPurchaseOrderDao;
import cn.com.shopec.erp.purchase.entity.PurchaseOrder;

/** 
 * @ClassName: PurchaseOrderDaoImpl 
 * @Description: 采购单表的dao实现
 * @author: lule
 * @date 2013-5-22 上午10:52:14
 *  
 */
@Repository
public class PurchaseOrderDaoImpl extends HibernateEntityDao<PurchaseOrder> implements IPurchaseOrderDao {

	/**
	 * 退货单count
	 * @param stockNo
	 * @return
	 */
	@Override
	public int getProductsCountByStockNo(Integer status) {
		DetachedCriteria detachedCriteria = createCriteria();
		detachedCriteria.add(Restrictions.eq("poStatus", status));
		return getCountByCriteria(detachedCriteria);
	}
}
